import { createApp } from "vue";
import App from "@/App.vue";

import "element-plus/dist/index.css";
import ElementPlus from "element-plus";
//@ts-ignore
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

//全局组件注册功能
import gloalComponent from "@/components/gloal/index";

//引入 svg插件
import "virtual:svg-icons-register";

//引入全局scss 清除默认样式
import "@/styles/index.scss";

//引入总路由
import router from "./router";

//引入pinia
import pinia from "@/store/index";

/**
 * 创建对象
 */
const app = createApp(App);
//注意一下引入pinia的位置
app.use(pinia);

//全局组件应用
app.use(gloalComponent);

/**
 * 引入elementplus
 * 中文国际化
 */
app.use(ElementPlus, {
  locale: zhCn,
});

app.use(router);

//引入守卫，进行鉴权功能
import "@/router/permisstion/index";

app.mount("#app");
